<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    #include("./include/header.html")
</head>
<body>
<div class="container" style="margin-top: 30px;">
    <div class="row">
        <div class="col-md-4">
        </div>
        <div class="col-md-4">
            <form id="loginForm" class="form-horizontal" role="form" action="/login" method="post">
                <div class="form-group">
                    <label for="username" class="col-sm-3 control-label">用户名</label>
                    <div class="col-sm-9">
                        <input type="text" class="form-control" id="username"
                               name="username" placeholder="请输入用户名">
                    </div>
                </div>
                <div class="form-group">
                    <label for="password" class="col-sm-3 control-label">密 码</label>
                    <div class="col-sm-9">
                        <input type="password" class="form-control" id="password"
                               name="password" placeholder="请输入密码">
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-sm-offset-3 col-sm-9">
                        <div class="checkbox">
                            <label>
                                <input type="checkbox" name="rememberMe"> 请记住我
                            </label>
                        </div>
                    </div>
                </div>
                #if (not_blank(error))
                <div class="form-group">
                    <div class="col-sm-offset-3 col-sm-9">
                        <span class="help-block" style="color: red">${error}</span>
                    </div>
                </div>
                #end
                <div class="form-group">
                    <div class="col-sm-offset-3 col-sm-9">
                        <button type="submit" class="btn btn-default">登录</button>
                    </div>
                </div>
            </form>
        </div>
        <div class="col-md-4">
        </div>
    </div>
</div>
#include("./include/footer.html")
<script>
    $(document).ready(function () {
        $("#loginForm").submit(function () {
            var val = $('input[name=rememberMe]').val();
            $('input[name=rememberMe]').val(val && val === 'on' ? 1 : 0);
        });
    });
</script>
</body>
</html>